<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/axios.js.js"></script>
    <script src="js/util.js.js"></script>
</head>
<body>
<div id="app">
    编号
    <input type="text" v-model="searchMap.code">
    姓名
    <input type="text" v-model="searchMap.name">
    <button type="button" @click="findPage(1)">查询</button>
    <table border="1">
        <tr>
            <td>id</td>
            <td>姓名</td>
            <td>编号</td>
            <td>年龄</td>
            <td>手机号</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in page.list">
            <td>{{item.id}}</td>
            <td>{{item.name}}</td>
            <td>{{item.code}}</td>
            <td>{{item.age}}</td>
            <td>{{item.phone}}</td>
            <td>操作</td>
        </tr>
    </table>
    <button type="button" @click="findPage(1)">首页</button>
    <button type="button" @click="findPage(page.prePage)">上一页</button>
    <button type="button" @click="findPage(page.nextPage)">下一页</button>
    <button type="button" @click="findPage(page.lastPage)">尾页</button>
</div>
<script>
    new Vue({
        el:"#app",
        data:{
            page:{},
            searchMap:{}
        },
        created(){
            this.findPage(1);
        },
        methods:{
            findPage(pageIndex){
                axios.post("/student/findPage.do?pageIndex="+pageIndex,this.searchMap).then(
                    res => {
                        this.page = res.data
                    }
                )
            },

        }
    })
</script>
</body>
</html>